<div class="title">
	<span>Appointment list</span>
	<div class="clear">&nbsp;</div>
</div>


<?php flash(); // display flash data?>
<?php
	if(!empty($bookings)){
		$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="tbl-list" id="booking-list">' );
		$this->table->set_heading('Customer', 'Stylist', 'Service', 'Date', 'Time', 'Status', 'Action');
		$this->table->set_template($tmpl);
		
		foreach($bookings as $v){
			$data = array(
					$v->cfname.' '.$v->clname,
					$v->sname.' '.$v->slname,
					$v->service,
					$v->adate,
					date('g:i A', strtotime($v->aps_time_from)).'-'.date('g:i A', strtotime($v->aps_time_to)),
					$v->status,
					'<a href="'.site_url('admin/delete/booking_list/'.$v->id).'" class="btn-icon delete" title="Delete">Delete</a>
					<a href="'.site_url('admin/view_booking/'.$v->id).'" class="btn-icon view" title="View Booking">View Booking</a>
				
					'
			);
			$this->table->add_row($data);	
		}
		echo $this->table->generate();
	}
	else {
		echo '<div class="msg notice"><span></span><h5>Notice</h5>No customers available yet.</div>';	
	}
?>
